<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text" value="">
            <button type="button" class="btn btn-primary" data-toggle="addresspicker" data-input-id="c-address" data-lat-id="c-latitude" data-lng-id="c-longitude">点击选择地址获取经纬度</button>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-longitude" data-rule="required" class="form-control" step="0.000001" name="row[longitude]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-latitude" data-rule="required" class="form-control" step="0.000001" name="row[latitude]" type="number">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Phone')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-phone" data-rule="required" class="form-control" name="row[phone]" type="text" value="">
        </div>
    </div>
<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Json')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            -->
<!--            <dl class="fieldlist" data-name="row[json]">-->
<!--                <dd>-->
<!--                    <ins>{:__('Key')}</ins>-->
<!--                    <ins>{:__('Value')}</ins>-->
<!--                </dd>-->
<!--                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>-->
<!--                <textarea name="row[json]" class="form-control hide" cols="30" rows="5"></textarea>-->
<!--            </dl>-->


<!--        </div>-->
<!--    </div>-->
    <table class="table table-responsive fieldlist" data-name="row[json]" data-template="testtpl" data-tag="tr">
           <tr>
               <td>车辆类型</td>
               <td>所需费用</td>
        <td></td>
           </tr>
           <tr>
               <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a></td>
           </tr>
           <textarea name="row[json]" class="form-control hide" cols="30" rows="5"></textarea>
    </table>
    <!--定义模板，模板语法使用Art-Template模板语法-->
    <script type="text/html" id="testtpl">
        <tr class="form-inline">
            <td><input name="<%=name%>[<%=index%>][vehicle_type]" data-rule="required" data-source="category/selectpage" class="form-control selectpage" data-params='{"custom[type]":"cartype","custom[pid]":["neq",0]}' type="text" value="<%=row['vehicle_type']%>" size="30" placeholder="可输入关键字搜索"></td>
            <td><input type="text" name="<%=name%>[<%=index%>][vehicle_price]" class="form-control" value="<%=row['vehicle_price']%>" size="10" placeholder="请输入正数金额"></td>
            <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span></td>
        </tr>
    </script>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-tags" data-rule="required" class="form-control" data-role="tagsinput" name="row[tags]" type="text" placeholder="英文逗号隔开">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="TypeList" item="vo"}
                <label for="row[type]-{$key}"><input id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-desc" class="form-control editor" rows="5" name="row[desc]" cols="50"></textarea>
        </div>
    </div>

<!--    <div class="form-group">-->
<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Applytime')}:</label>-->
<!--        <div class="col-xs-12 col-sm-8">-->
<!--            <input id="c-applytime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[applytime]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!--        </div>-->
<!--    </div>-->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
